'use strict'

class  dingdan{
  
  constructor () {

  }
 
  async list (c) {
    console.log(c.query)
    let wuser = c.service.model.dingdan
    let ulist = await wuser.get(c.query.userid,c.query.id)
    c.send(ulist)
  }

  async post(c){
    let data=JSON.parse(c.body)
    let wuser = c.service.model.dingdan
    let id=await wuser.insert(data)
    c.send(id)
  }

   //修改数据
   async put(c){
      let id=c.param.id
      let data= JSON.parse(c.body)
      let wuser =c.service.model.dingdan
      await wuser.update(data,id)
  }

}

module.exports = dingdan